package com.ch999.detect.View.dialog;

import android.content.Context;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;

import com.ch999.detect.R;
import com.ch999.detect.View.SelectStartDialog;

/**
 * Created by Administrator on 2016/12/13 0013.
 */

public class Show2CodeDialog extends SelectStartDialog implements View.OnClickListener {

    View.OnClickListener listener;
    private ImageView img2Cade;
    private FrameLayout imgCancel;

    public Show2CodeDialog(Context context, View.OnClickListener listener) {
        super(context);
        this.listener = listener;
    }
    public Show2CodeDialog(Context context) {
        super(context);

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_2code_layout);
        img2Cade = (ImageView) findViewById(R.id.img_2code);

        imgCancel = (FrameLayout) findViewById(R.id.fl_cancel);
        imgCancel.setOnClickListener(this);
    }


    public void showDialog(String filePath) {
        this.show();
        img2Cade.setImageBitmap(BitmapFactory.decodeFile(filePath));
    }

    @Override
    public void onClick(View view) {
       dismiss();
    }
}
